/*
 * GeoVISTA Center (Penn State, Dept. of Geography)
 * Copyright (c), 2003-2011,  Jin Chen and Alan M. MacEachren, GeoVISTA Center, Penn State University
 * Licensed under Simplified BSD License
 *
 *
 * @author: jin Chen 
 * @date: Sep 10, 2004$
 * @version: 1.0
 */
package edu.psu.geovista.app.pcp.toolkits.table.actions;

import edu.psu.geovista.app.pcp.toolkits.table.ConfigureTable;
import edu.psu.geovista.app.pcp.toolkits.table.TableConstants;

import javax.swing.*;

public abstract class BasicTableAction extends AbstractAction {
    protected JComponent owner;
    protected ConfigureTable table;

    protected BasicTableAction(JComponent owner, ConfigureTable table) {
        this.owner = owner;
        this.table = table;
    }

    protected BasicTableAction(String name, JComponent owner, ConfigureTable table) {
        super(name);
        this.owner = owner;
        this.table = table;

        ImageIcon imageIcon = TableConstants.getImageIcon(name);
        if(imageIcon!=null){
           this.putValue(Action.SMALL_ICON ,imageIcon);
        }
    }

    protected BasicTableAction(String name, Icon icon, JComponent owner, ConfigureTable table) {
        super(name, icon);
        this.owner = owner;
        this.table = table;
        
        ImageIcon imageIcon = TableConstants.getImageIcon(name);
        if(imageIcon!=null){
           this.putValue(Action.SMALL_ICON ,imageIcon);
        }
    }


}
